Hi all,
We have one custom form and that form i want to add one button(Renewal).
Old forms records.
1. worker
2. Name
3. no of amount.
4. total amount
5. ticket cost
6. valid from(effective date)
7. valid to (effective date)
8. contract number
New thing i want to do below steps.
1. worker
2. Name
3. no of amount.
4. total amount
5. ticket cost
6. valid from(effective date) (I want to change)
7. valid to (effective date) (i want to change)
8. contract number (I want to change)
Note :- it should be like copy records and update that 3 fields only and if we add it to that three fields already an available record in this case (i want to throw some error while click button new value only to accept).
The same form i add drop dialog button and there is four fields.
1. worker (don't change existing shows as an etc -(000005)
2. valid from(effective date) (I want to change)
3. valid to (effective date) (i want to change)
4. contract number (I want to change)
once i fill the value to drop dialog and it should be updated - 000005(that three records remaining value keep it as old) so that i wrote code.
DialogField dialog;
Dialog dlg = new Dialog("Renewal");
Grades headerCopy;
HcmWorkerRecid worker;
fld = dialog.addField(extendedTypeStr(HcmWorkerRecid)); // This EDT i don;t wanna select by default value i want to based on worker selected in custom worker aaginst.
if(dialog.run())
{
worker = fld.value();
if(worker)
{
select firstonly headerCopy
where headerCopy.worker == worker;
if(headerCopy.RecId)
{
ttsbegin;
Grades.selectForUpdate(true);
Grades.validTimeStateUpdateMode(ValidTimeStateUpdate::Correction);
Grades.Worker = headerCopy.Worker;
Grades.NumOfTicket = headerCopy.NumOfTicket;
Grades.contractNo = headerCopy.contract; //i fill as new value
Grades.TotalAmount = headerCopy.TotalAmount;
Grades.Totalcost = headerCopy.Totalcost;
Grades.Validfrom = headerCopy.Validfrom; /i fill as new value
Grades.Validto = headerCopy.Validto; /i fill as new value
Grades.Update();
ttscommit;
}
}
As i mentioned code i write in clicked method (grades) dataSource name.
Now, i want to drop dialog form how can i do that and in the drop dialog we need add (grades) dataSource? and that three fields already same value give it to i want to error hwo to do please give me on that.
Thanks