Announcements
Hi,There is one form1 with field item id. Once you click on "Create" button in action pane, another dialog form2 opens, where there is a field names item id. Now once create action is initialized, the form 1 item id must be auto populated in the item field in form 2 dialog form. Both the form uses same table. I used init method on form 2, but it is not working. Any help?
Hi RSX,
Are you able to share the code you used in the init() method? Can you also describe what you mean with "is not working"? Do you get an error or a wrong or empty record?
Hi Andre,
Is not working means, there is no error, But it is showing empty record only.
Code ::
Comx_AdditionalDetails gAdditionalDetails; //globally declared
public void init()
{
super();
if(element.args().record().tableId == tableNum(Comx_AdditionalDetails))
gAdditionalDetails = element.args().record();
Comx_AdditionalDetails.itemNumber = gAdditionalDetails.itemNumber;
}
Is the Comx_AdditionalDetails record already saved in DB?
If so, you should set a filter on the form instead of trying to populate the field only.
It it's not, I think that the contents of Comx_AdditionalDetails gets overwritten when a new record gets created automatically (or maybe there is no record at all). initValue() of the data source may be a good place for this logic.
Also, please always use Insert > Code (in the rich formatting view) to paste source code. It'll be easier to read and copy:
Comx_AdditionalDetails gAdditionalDetails; //globally declared public void init() { super(); if (element.args().record().tableId == tableNum(Comx_AdditionalDetails)) { gAdditionalDetails = element.args().record(); Comx_AdditionalDetails.itemNumber = gAdditionalDetails.itemNumber; } }
Hi Martin,
Thank you.
I used initvalue and now the value is getting updated.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 265 Most Valuable Professional
André Arnaud de Cal... 261 Super User 2026 Season 2
Subra 229 Super User 2026 Season 2