Показать сообщение отдельно
Старый 16.08.2013, 10:32   #3  
ansoft is offline
ansoft
Участник
Аватар для ansoft
 
123 / 37 (2) +++
Регистрация: 20.10.2005
Можно как-то так:

Класс SysRecordTemplateStorageUser:
X++:
public Common set()
{
    ListEnumerator enumerator = list.getEnumerator();
;
    // Добавить {
    if (enumerator.moveNext())
        common = enumerator.current();
    else
        common = null;
    enumerator.reset();
    // }

    if (!description)
        [description,details] = this.promptOnCreate(common); // добавить common

    if (description)
    {
        enumerator.moveNext();
        common = enumerator.current();

        xSysLastValue::getLast(this);
        this.validateDescription(description, value);
        value += [[description, false, this.packList(),details]];
        xSysLastValue::saveLast(this);
    }
    return null;
}
Класс SysRecordTemplateStorage:
X++:
protected container promptOnCreate(common _common = null) // Добавить (common _common = null)
{
    SysRecordTemplatePromptOnCreate dialog1 = new SysRecordTemplatePromptOnCreate();
;
    // Добавить {
    if (_common && _common.TableId == tableNum(InventTable))
        dialog1.setDescription(_common.(fieldNum(InventTable, ItemName)));
    // }

    if (dialog1.prompt())
    {
        dialog1.getFromDialog();
        return [dialog1.getDescription(), dialog1.getDetails()];
    }

    return ['',''];
}
Класс SysRecordTemplatePromptOnCreate:
X++:
public Object dialog()
{
    Args args = new Args(formstr(SysRecordTemplatePromptOnCreate));
    Object objForm;
    ;
    dialogForm = classfactory.formRunClass(args);
    dialogForm.init();
    // Добавить {
    if (description)
    {
        objForm = dialogForm;
        objForm.setDescription(description);
    }
    // }

    return dialogForm;
}
И в этот же класс добавить метод:
X++:
// Добавить {
public void setDescription(SysRecordTemplateDescription _description)
{
    ;
    description = _description;
}
// }
В форме SysRecordTemplatePromptOnCreate создать метод:
X++:
// Добавить {
public void setDescription(SysRecordTemplateDetails _details)
{
    ;
    description.text(_details);
}
// }

Последний раз редактировалось ansoft; 16.08.2013 в 10:44.