This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How to Link Data in to Data type from one form to another form.

Dhivya.L - Thursday, December 20, 2012 4:11 AM:

Hello,

   I have created two form 1)Employee Information   2) Job Details.

  The employee information Form Contains the Fields like "JobTitle", "Employee name" and etc. [Here "Job title" is a Drop down list or Item Data Type].

   The Job Details form contains the fields like "Job Title" and "Job Description". [Here the job title is Text box]

 Now i want to link the Job Title data's from the form "Job Details " in to "Employee Infromation"  "jo Title".

For  Example:-

1) HR or admin will be adding the data's in to "job title" field in "Job Details"  form. [data's like --> Manager, Business Analysist].

2) When i click on "job title" Dropdown list in Employee information form, i should get that Data's[Manager, Business Analysist] to be displayed in it.

 How should i do it ?

Please any one help me out with this.

 

Thanks,

Dhivya. L



Dhivya.L - Thursday, December 20, 2012 6:19 AM:

Hello,

Could any one help me out please.

 

Thanks,

Dhivya. L



pravinnalkande - Thursday, December 27, 2012 4:20 AM:

Hi Dhivya,

You wants to show list of job title into the "Employee Information" from "Job Details" .

Please follow the below steps :

1) Create one list which stores all the job titles(When you save the job details item fire the event such that this method will add the new job title to the list that is we already created into the aras)

e.q.JobTitle_list

2) In Employee Information form you can use that list(JobTitle_list) as a datasource this will be dropdown having all the job_titles from Job Details item type.

Hope this helps you..

Cheers,

Pravin



Dhivya.L - Friday, December 28, 2012 12:42 AM:

Hello pravin,

  Thanks for your reply.

  You mean that, i need to create one JobTItle_List.  and also i need to create one new method am i right?

or already we have the method in Aras?

I am not getting. If you dont mind, could you please explain me  the steps clearly, what i need to do. 

Thanks,

Dhivya. L

 

 



pravinnalkande - Friday, December 28, 2012 1:06 AM:

Hi Dhivya,

Please follow the steps :

Goal: You want to show the list of job title into the employee form from job details form.

1) Create one blank list name as 'Job Title'

2) On Job Details item type write one server side event (onAfterAdd). The method has logic like getting the blank list we have already created and add the values  into it as job title.

3) So whenever you add the new job title from Job Details form you will get the updated list of job title.

4) Use this job title list as a data source in your Employee Information form.

 

Thanks,

Pravin



Dhivya.L - Friday, December 28, 2012 3:28 AM:

Hello Pravin,

   Thank you very much for your reply.

 As i understood, i should write one javascript method to get the list.

But as i am new to aras. i dont know the scripting and mothod creations.   Is there any sites or scripting available in Net. Is it  to get it ?

If you could help me out with this. It will be very helpfull for me.

can i get your Email ID pelase?

Thanks,

Dhivya.L

 

 

 

 

  



Dhivya.L - Friday, December 28, 2012 4:42 AM:

Hello Pravin,

  Could you please help me on this topic?

 

Thanks,

Dhivya. L

 



pravinnalkande - Friday, December 28, 2012 6:20 AM:

Hi Dhivya,

please look at the sample code.

Step--I

Server side method===>c#......Server Event==>OnAfterAdd

//==========================================================

Innovator inn=this.getInnovator();

string job_title_value=this.getProperty("job_title");

/--------get empty list that is already created in aras----------

Item getList=this.newItem("List","get");

getList.setProperty("name","job_title");

Item getList_res=getList.apply();

/--------add job title values to list-----------

Item addList=this.newItem("List","add);

addList.setProperty("label",job_title_value);

addList.setProperty("value",job_title_value);

addList.setAttribute("where","[List].name like '"+job_title+"'");

Item addList_res=addList.apply();

//========================================================

This is just sample code,you can modify it to implement your logic.

Step--II

Create one property job_title_InEmp data type as list in Emp Information form

and data source is job_title list as created above.

Step-III

So when you will go to create the emp information item you will get the list of job_titles in dropdown.

Thanks,

Pravin



Harsha - Friday, December 28, 2012 7:41 AM:

Dhivya, You can try the following simple VB code .

 

 

Dim inn As Innovator = Me.getInnovator()

Dim job_title As String = Me.getProperty("job_title")

 

Dim item_list As Item = Me.NewItem("List","get")

item_list.SetAttribute("select","name")

item_list.SetProperty("name", "Job Title")

item_list.SetPropertyCondition("name", "like")

Dim item_results As Item = item_list.Apply()

 

Dim item_list_add As Item = Me.NewItem("List","add")

item_list_add.setProperty("label",job_title)

item_list_add.setProperty("value",job_title)

Dim results As Item = item_list_add.Apply()

It is a sample code that will help you. Not a running code.
ThankYou / Harsha

 



Dhivya.L - Friday, December 28, 2012 7:41 AM:

Hello Pravin,

Thanks for your sample code.

I have tried this but i am getting the error like below;

"job_title is not available in the current context". in the line ; addList.setAttribute("where","[List].name like '"+job_title+"'");

i have some doubts;

1) what is that getProperty("job_title"); .  could you please let me know which property is this? is this for, JobDetails form Property?

 

Thanks,

Dhivya.L

    

 

 

 



Dhivya.L - Wednesday, January 2, 2013 9:03 AM:

Hello Harsha,

 

  Thanks for your code.

 i have tried but i am getting the error like below;

Cannot insert the value NULL into Column ‘NAME’, table”DEV.innovator.LIST’  column doesnot allow null vlues. INSERT fails. The statement has been terminated in SQL:INSERT INTO [LIST] ([CONFIG_ID],)VALUES (@p0)

Thanks,

Dhivya.L



pravinnalkande - Monday, December 31, 2012 12:05 AM:

Hi Dhivya,

job_title is the Job Details form property

you have to get the property value like as below:

string  job_title=this.getProperty("job_title");

Thanks ,

Pravin



Dhivya.L - Thursday, January 3, 2013 1:42 AM:

Hello Harsha,

 

     Could you please help me out with the above error.

 

Thanks,

Dhivya. L



Dhivya.L - Thursday, January 3, 2013 4:22 AM:

Hello Harsha/ Pravin,

   I have tried the Above VB code.  Running scrip was Successful [It was showing message like ; OK ].

  While i am trying to add the values to job_title Text field in Job details form, while clicking on save i am getting the below error;

Cannot insert the value NULL into Column ‘NAME’, table”DEV.innovator.LIST’  column doesnot allow null vlues. INSERT fails. The statement has been terminated in SQL:INSERT INTO [LIST] ([CONFIG_ID],)VALUES (@p0)

So what i have i tried is , I have added the job-title "value" and "label" values as "manager" in to the Blank list. And in Employee information form i can able to retrieve that "manager" job_title. But this not an exact solution what i was trying.

what i want exactly is the below steps;

while adding the values in job-title text field in job details form, it should call the vb code and add it to the Blank list.  Then the added job_title should display   in Employee information job-title Dropdown list.

Please any one help me to fix the above code error.

Thanks,

Dhivya.L

 

    

 



Dhivya.L - Monday, January 7, 2013 2:11 AM:

Hello all,

   Please any one help me with this issue.

Thanks,

Dhivya.L

 

  



Harsha - Monday, January 7, 2013 7:54 AM:

Hi Dhivya,

 Try this:

Dim inn As Innovator = Me.getInnovator()

Dim job_title As String = Me.getProperty("job_title")    'Property of the text field                                                                                                                                             Dim listItem As Item = Me.newItem("List","add")                                                                                                                                   listItem.setProperty("name","Job_Title")  'List name

Dim relatedItem As Item = Me.newItem("Value","add")                                                                                                                             relatedItem.setProperty("label",job_title)                                                                                                                                                   relatedItem.setProperty("value",job_title)                                                                                                                                                       listItem.setRelatedItem(relatedItem)                                                                                                                                                         listItem.addRelationship(relatedItem)                                                                                                                                                                                                                    Dim resultItem As Item = listItem.apply()

 

Thank you, Harsha.

 



Harsha - Tuesday, January 8, 2013 4:53 AM:

 

Sorry, made a mistake.  You want to add values to the existing List right? Then try this:

 

Dim inn As Innovator = Me.getInnovator()                                                                                                                                                                                                              Dim job_title As String = Me.getProperty("job_title")    'Property of the text field                                                                                                                                             Dim listItem As Item = inn.getItemById("List", "AAF1F082505444D8BEF3DB8BDA6B351A")  'ID of the list 

Dim relatedItem As Item = Me.newItem("Value","add")                                                                                                                         relatedItem.setProperty("label",job_title)                                                                                                                                                 relatedItem.setProperty("value",job_title)                                                                                                                                                           listItem.setRelatedItem(relatedItem)                                                                                                                                                         listItem.addRelationship(relatedItem)                                                                                                                                                                                                                 Dim resultItem As Item = listItem.apply()                                                                                                                                                                                                         Return Me

 

Hope this will help you. 

Harsha

 



Dhivya.L - Wednesday, January 9, 2013 6:25 AM:

Hello Harsha,

   Thanks for your code.  Many thanks for your help :)

  It works good.   But only thing is that After adding the values in to the job details form (in job-title text field and save). Its successfully adding in to the existing list.

After that if i am opening the employee information form and try to add the job-title in dropdown list, the value is not displaying . if i refresh also it is not displaying.  then once close the innovator and reopened it that time i could able to retrive the value from list and select the values in job title dropdown list.

May i know why it is like this?  Should i need to close the application everytime and relogin it ? Or else any possibilities are there to refresh it in our code itself?

 

Thanks,

Dhivya. L

 

 

 

 

 

 



Dhivya.L - Wednesday, January 16, 2013 6:30 AM:

hello harsha,

  Thanks for your support. It works good.

  I need one more favour from you.

 While selecting the job title from drop down list, i am getting the job-title ID.  In Dropdown list ID is displaying.

But i want to display the name property instead of ID.

I have tried this step, In Job-title property, In Keyed Name property i have given 1.  Even though the name is not displaying.

Could you please help me. Is there anyother way to fix this?

Please help me out.

 

Thanks,

Dhivya.L

 

 

 

 



Harsha - Friday, January 18, 2013 2:59 AM:

Hi Dhivya, Actually Keyed name will do that . Any way try this:

 relatedItem.setPropertyAttribute("label","keyed_name")

 

 



Dhivya.L - Friday, January 18, 2013 4:57 AM:

Hello Harsha,

 Thanks for you reply.

 I have tried the above line in method. but i am getting the below error while running the script.

Error:-

"Could not find file 'C:Program Files (x86)ArasInnovatorInnovatorServerdllizmtanfx.dll'."

  could you please chek this.

Thanks,

Dhivya. L



Harsha - Friday, January 18, 2013 5:56 AM:

 

Please go to that location and open izmtanfx.out(generates new dll every time you run the code) file it contains the errors in the code.  But the above code working fine for me.

Harsha.



Dhivya.L - Friday, January 18, 2013 6:08 AM:

Hello harsha,

 

   yeah sure. If you dont mind, could you please post your email Id here, so that i can send you a test mail.

 

Thanks,

Dhivya. L



Harsha - Friday, January 18, 2013 6:18 AM:

harvinsha@gmail.com



Dhivya.L - Thursday, January 24, 2013 3:02 AM:

  Hello Harsha,

            I just send a mail to you. Please check and get back to me soon.

 

Thanks,

Dhivya.L