MP0303_SyncAssetEquipment - Commission Date field cannot be blank - infor-eam

I am getting the following error using infor-eam MP0303_SyncAssetEquipment:
"Commission Date field cannot be blank."
I have coded for the commission date:
getrequest.AssetEquipment.COMMISSIONDATE = new MP0303_SyncAssetEquipment_001.DATETIME();
getrequest.AssetEquipment.COMMISSIONDATE.YEAR = result.AssetEquipment.COMMISSIONDATE.YEAR;
getrequest.AssetEquipment.COMMISSIONDATE.MONTH = result.AssetEquipment.COMMISSIONDATE.MONTH;
getrequest.AssetEquipment.COMMISSIONDATE.DAY = result.AssetEquipment.COMMISSIONDATE.DAY;
getrequest.AssetEquipment.COMMISSIONDATE.HOUR = result.AssetEquipment.COMMISSIONDATE.HOUR;
getrequest.AssetEquipment.COMMISSIONDATE.MINUTE = result.AssetEquipment.COMMISSIONDATE.MINUTE;
getrequest.AssetEquipment.COMMISSIONDATE.SECOND = result.AssetEquipment.COMMISSIONDATE.SECOND;
getrequest.AssetEquipment.COMMISSIONDATE.SUBSECOND = result.AssetEquipment.COMMISSIONDATE.SUBSECOND;
getrequest.AssetEquipment.COMMISSIONDATE.TIMEZONE = result.AssetEquipment.COMMISSIONDATE.TIMEZONE;
But still getting the same error message. Any ideas?
Thanks Before Hand

You are missing these:
getrequest.AssetEquipment.COMMISSIONDATE.qualifier = new MP0303_SyncAssetEquipment_001.DATETIMEqual();
getrequest.AssetEquipment.COMMISSIONDATE.qualifier = (MP0303_SyncAssetEquipment_001.DATETIMEqual)result.AssetEquipment.COMMISSIONDATE.qualifier;

Related

probleme de renitialisation d'un QtreeWidget

I am developing an application that allows to place orders with python and QtDesigner. I can't manage to place two commands in a row. The first command passes without any problem but when I want to place another command without closing the application, this error is displayed: "self.ui.treeWidgetcommand.topLevelItem(self.Line ).setText(0, str(Id))
AttributeError: 'NoneType' object has no attribute 'setText'".
def AddCommande(self):
QtWidgets.QTreeWidgetItem(self.ui.treeWidgetcommande)
Libelle = self.ui.comboBoxproduit.currentText()
Qte = int(self.ui.lineEditQteproduit.text())
Info = self.stock.GetProductName(Libelle)[0]
Id = str(int(Info[0]))
Pu = Info[1]
Total = int(Qte)*int(Pu)
data=(Libelle,Qte,Id,Pu,Total)
#print(data)
self.ui.treeWidgetcommande.topLevelItem(self.Ligne).setText(0, str(Id))
self.ui.treeWidgetcommande.topLevelItem(self.Ligne).setText(1, str(Libelle))
self.ui.treeWidgetcommande.topLevelItem(self.Ligne).setText(2, str(Qte))
self.ui.treeWidgetcommande.topLevelItem(self.Ligne).setText(3, str(Pu))
self.ui.treeWidgetcommande.topLevelItem(self.Ligne).setText(4, str(Total))
self.Ligne +=1
def ValiderCommande(self):
Client = self.ui.comboBoxclient.currentText()
IdClient = self.stock.GetClientIdByName(Client.split(" ")[0])
PrixTotal = 0
UniqueId = random.random()
Date = date.today()
Data = (IdClient,PrixTotal,Date,UniqueId)
if self.stock.AddCommande(Data) == 0:
for i in range(self.Ligne):
IdCommande = self.stock.GetClientIdByUniqueId(UniqueId)
Libelle = self.ui.treeWidgetcommande.topLevelItem(i).text(1)
IdProduit = self.ui.treeWidgetcommande.topLevelItem(i).text(0)
Pu = self.ui.treeWidgetcommande.topLevelItem(i).text(3)
Qte = self.ui.treeWidgetcommande.topLevelItem(i).text(2)
Total = int(self.ui.treeWidgetcommande.topLevelItem(i).text(4))
InfoData = (IdCommande, Libelle, Qte, Pu, Total)
data = (Qte,IdProduit)
if self.stock.AjoutInfoCommande(InfoData) == 0:
PrixTotal += Total
self.stock.UpdateQteStock(data)
if self.stock.UpdateCommande(PrixTotal,IdCommande) == 0:
self.ui.treeWidgetcommande.clear()
#self.ui.treeWidgetcommande.topLevelItem(self.Ligne).setHidden(True)
self.ui.lineEditQteproduit.setText(" ")
`
I would like after placing an order, reset my treeWidget array and be able to place other orders.

DocuSign Require Signing Document Twice with Different Tabs

I have a document that is using tabs to fill a document. The document is signed before and after completion of a task. Is it possible to modify tabs on an envelope - then re-generate an DocuSign_eSign::RecipientViewRequest (still having the initial signature / fields)?
Thus far I've been able to generate two DocuSign_eSign::RecipientViewRequest, but cannot figure out how to change the tabs in between signing:
PRE_SIGNER = 'pre_signer'
POST_SIGNER = 'post_signer'
PRIVATE_KEY = CREDENTIALS['private_key']
PUBLIC_KEY = CREDENTIALS['public_key']
USER_ID = CREDENTIALS['user_id']
CLIENT_ID = CREDENTIALS['client_id']
ACCOUNT_ID = CREDENTIALS['account_id']
BASE_URL = CREDENTIALS['base_url']
configuration = DocuSign_eSign::Configuration.new
configuration.host = "#{BASE_URL}/restapi"
configuration.debugging = true
api_client = DocuSign_eSign::ApiClient.new(configuration)
api_client.base_path = BASE_URL
envelope_api = DocuSign_eSign::EnvelopesApi.new(api_client)
pre_signer_text = DocuSign_eSign::Text.new
pre_signer_text.value = 'Alpha'
pre_signer_text.tab_label = 'pre_value'
pre_signer = DocuSign_eSign::Signer.new
pre_signer.role_name = PRE_SIGNER
pre_signer.client_user_id = PRE_SIGNER
pre_signer.recipient_id = 1
pre_signer.name = 'Kevin Sylvestre'
pre_signer.email = 'kevin#fake.com'
pre_signer.tabs = DocuSign_eSign::Tabs.new
pre_signer.tabs.text_tabs = [pre_signer_text]
post_signer = DocuSign_eSign::Signer.new
post_signer.role_name = POST_SIGNER
post_signer.client_user_id = POST_SIGNER
post_signer.recipient_id = 2
post_signer.name = 'Kevin Sylvestre'
post_signer.email = 'kevin#fake.com'
post_signer.tabs = DocuSign_eSign::Tabs.new
post_signer.tabs.text_tabs = []
server_template = DocuSign_eSign::ServerTemplate.new
server_template.sequence = 0
server_template.template_id = TEMPLATE_ID
inline_template = DocuSign_eSign::InlineTemplate.new
inline_template.sequence = 0
inline_template.recipients = DocuSign_eSign::Recipients.new
inline_template.recipients.signers = [
pre_signer,
post_signer,
]
composite_template = DocuSign_eSign::CompositeTemplate.new
composite_template.server_templates = [server_template]
composite_template.inline_templates = [inline_template]
envelope_event = DocuSign_eSign::EnvelopeEvent.new
envelope_event.envelope_event_status_code = 'completed'
envelope_definition = DocuSign_eSign::EnvelopeDefinition.new
envelope_definition.status = 'sent'
envelope_definition.composite_templates = [composite_template]
api_client.request_jwt_user_token(CLIENT_ID, USER_ID, PRIVATE_KEY)
envelope = envelope_api.create_envelope(ACCOUNT_ID, envelope_definition)
pre_signer_recipient_view_request = DocuSign_eSign::RecipientViewRequest.new
pre_signer_recipient_view_request.authentication_method = 'none'
pre_signer_recipient_view_request.client_user_id = PRE_SIGNER
pre_signer_recipient_view_request.user_name = 'Kevin Sylvestre'
pre_signer_recipient_view_request.email = 'kevin#fake.com'
pre_signer_recipient_view_request.return_url = 'https://ksylvest.com'
pre_recipient_view = envelope_api.create_recipient_view(ACCOUNT_ID, envelope.envelope_id, pre_signer_recipient_view_request)
url = pre_recipient_view.url
`open #{url}`
puts "Continue?"
gets
# at this point I'd like to enter values for tabs...
post_signer_text = DocuSign_eSign::Text.new
post_signer_text.value = 'Omega'
post_signer_text.tab_label = 'post_value'
post_signer_recipient_view_request = DocuSign_eSign::RecipientViewRequest.new
post_signer_recipient_view_request.authentication_method = 'none'
post_signer_recipient_view_request.client_user_id = POST_SIGNER
post_signer_recipient_view_request.user_name = 'Kevin Sylvestre'
post_signer_recipient_view_request.email = 'kevin#fake.com'
post_signer_recipient_view_request.return_url = 'https://ksylvest.com'
post_recipient_view = envelope_api.create_recipient_view(ACCOUNT_ID, envelope.envelope_id, post_signer_recipient_view_request)
url = post_recipient_view.url
`open #{url}`
You could add the same person to sign twice, as two separate recipients that are the same person. You can generate different recipient views. You can set the routing order to be different. Only reason I didn't post this as an answer is that you may mean that you need to pause the envelope?
you can add tabs using your code where you have post_signer.tabs, but if you want to modify existing tabs that came from the template then you have to create the envelope in draft mode ("created") and then make a different API call to modify the tabs and then a final API call to send it. Another option is to pause the envelope and "correct" it.
Pause envelope workflow code examples
https://github.com/docusign/docusign-esign-ruby-client/blob/c477b07c2f578214fdf7d0c5a33355f01e9a0b4e/lib/docusign_esign/api/envelopes_api.rb#L6132 update_recipients() method should do the trick...

Updating DataTable inside as DataSet

In an accounting WPF app we have a number of public DataTables that reload data once a tab is opened. This works great locally as the reports just refer to those tables..
For some more complex reports we have just set up a Web Service to run them and return a PDF... To make it easier I thought of loading these DataTables into a DataSet and then extracting them at the server end. This works perfectly the first time it's run, but then (as best as I can work out so far) it's sending the incorrect (last loaded) data for subsequent reports. Locally it still works as it should but the DataTables we are sending in the DataSet appear to not be updating. Have tried to remove the tables and re-add them again, but that just throws a 'object reference not set' the first time a DataRow is selected from a DataTable at the server.
Must be something very basic I have been missing :-(
Any ideas?
Thanks
Private Async Sub RunProfitAndLossOnServer(sender As Object, e As RoutedEventArgs)
Try
Dim StartDateTB As DateTBx = ReportBalanceSheet_Grid.FindName("BalanceSheet_StartDateTB")
Dim EndDateTB As DateTBx = ReportBalanceSheet_Grid.FindName("BalanceSheet_EndDateTB")
ReportStartDate = StartDateTB.Value
ReportEndDate = EndDateTB.Value
ReportDate = Today
ReportName = "Profit and Loss Report"
PaperLandscape = False
ReportFontSize = 8
PopupModals_ReportGenerator()
If ReportGeneratorRun = True Then
Dim vPDF() As Byte = Nothing
'Determine if the Export Dataset has already been created
If ExportDS Is Nothing Then
ExportDS = New DataSet
VariablesDT = New DataTable
With VariablesDT.Columns
.Add("Current_HOA_Name", GetType(String))
.Add("Current_HOA_ID", GetType(Integer))
.Add("ReportName", GetType(String))
.Add("ReportFontSize", GetType(Integer))
.Add("ReportStartDate", GetType(Date))
.Add("ReportEndDate", GetType(Date))
.Add("User_InternationalDate", GetType(Integer))
.Add("PaperSize", GetType(String))
.Add("PaperLandscape", GetType(Boolean))
.Add("Reports_IsSplitGL", GetType(Boolean))
.Add("Form_ID", GetType(Integer))
End With
With VariablesDT.Rows
.Add(Current_HOA_Name, Current_HOA_ID, ReportName, ReportFontSize, ReportStartDate, ReportEndDate, User_InternationalDate, PaperSize, PaperLandscape, False, Form_ID)
End With
VariablesDT.TableName = "VariablesDT"
ExportDS.Tables.Add(VariablesDT)
ResIncomeDT.TableName = "ResIncomeDT"
ExportDS.Tables.Add(ResIncomeDT)
ResIncNomDT.TableName = "ResIncNomDT"
ExportDS.Tables.Add(ResIncNomDT)
ResExpensesDT.TableName = "ResExpensesDT"
ExportDS.Tables.Add(ResExpensesDT)
ResExpNomDT.TableName = "ResExpNomDT"
ExportDS.Tables.Add(ResExpNomDT)
RevenueDT.TableName = "RevenueDT"
ExportDS.Tables.Add(RevenueDT)
ExpensesDT.TableName = "ExpensesDT"
ExportDS.Tables.Add(ExpensesDT)
RevenueNomDT.TableName = "RevenueNomDT"
ExportDS.Tables.Add(RevenueNomDT)
ExpensesNomDT.TableName = "ExpensesNomDT"
ExportDS.Tables.Add(ExpensesNomDT)
Else
ExportDS.Tables.Remove("ResIncomeDT")
ExportDS.Tables.Remove("ResIncNomDT")
ExportDS.Tables.Remove("ResExpensesDT")
ExportDS.Tables.Remove("ResExpNomDT")
ExportDS.Tables.Remove("RevenueDT")
ExportDS.Tables.Remove("ExpensesDT")
ExportDS.Tables.Remove("RevenueNomDT")
ExportDS.Tables.Remove("ExpensesNomDT")
ExportDS.Tables.Add(ResIncomeDT)
ExportDS.Tables.Add(ResIncNomDT)
ExportDS.Tables.Add(ResExpensesDT)
ExportDS.Tables.Add(ResExpNomDT)
ExportDS.Tables.Add(RevenueDT)
ExportDS.Tables.Add(ExpensesDT)
ExportDS.Tables.Add(RevenueNomDT)
ExportDS.Tables.Add(ExpensesNomDT)
ExportDS.Tables.Remove("VariablesDT")
For Each row As DataRow In VariablesDT.Rows
row("Current_HOA_Name") = Current_HOA_Name
row("current_HOA_ID") = Current_HOA_ID
row("ReportFontSize") = ReportFontSize
row("User_InternationalDate") = User_InternationalDate
row("PaperSize") = PaperSize
row("PaperLandscape") = PaperLandscape
row("Reports_IsSplitGL") = False
row("ReportStartDate") = ReportStartDate
row("ReportEndDate") = ReportEndDate
row("ReportName") = ReportName
row("Form_ID") = Form_ID
Next
ExportDS.Tables.Add(VariablesDT)
End If
Dim vImage As New LoadingImage
LoadingStarted("Uploading to xSoftware... Please wait...", vImage)
Await Task.Run(Sub()
Using vService As New Service5Client
vPDF = vService.ReturnProfitAndLossSheet(ExportDS)
End Using
End Sub)
LoadingCompleted("File uploaded to xSoftware...", "File was uploaded and PDF returned...", vImage)
Dim vFile As String = ByteToFilePath(vPDF)
If System.IO.File.Exists(vFile) Then
Dim P As New Process
With P
.StartInfo.FileName = vFile
.StartInfo.Verb = "Open"
.Start()
End With
Else
AppBoxError("The file path for the PDF is not valid!")
End If
End If
Catch ex As Exception
EmailError(ex)
End Try
End Sub
Throws an error at the server end if we remove and add the datatables back to the DataSet
Dim RevenueData() As DataRow = RevenueDT.Select("FormID = " & Form_ID, "Position")
Dim ExpenseData() As DataRow = ExpensesDT.Select("FormID = " & Form_ID, "Position")
Dim RevenueNomData() As DataRow = RevenueNomDT.Select("FormID = " & Form_ID, "Position")
Dim ExpenseNomData() As DataRow = ExpensesNomDT.Select("FormID = " & Form_ID, "Position")
It looks like the answer is
Remove the DataTables from the DataSet and add them again (which got us part of the way there)
Name the DataTables again!
ExportDS.Tables.Remove("ResIncomeDT")
ExportDS.Tables.Remove("ResIncNomDT")
ExportDS.Tables.Remove("ResExpensesDT")
ExportDS.Tables.Remove("ResExpNomDT")
ExportDS.Tables.Remove("RevenueDT")
ExportDS.Tables.Remove("ExpensesDT")
ExportDS.Tables.Remove("RevenueNomDT")
ExportDS.Tables.Remove("ExpensesNomDT")
ExportDS.Tables.Remove("VariablesDT")
VariablesDT.TableName = "VariablesDT"
ExportDS.Tables.Add(VariablesDT)
ResIncomeDT.TableName = "ResIncomeDT"
ExportDS.Tables.Add(ResIncomeDT)
ResIncNomDT.TableName = "ResIncNomDT"
ExportDS.Tables.Add(ResIncNomDT)
ResExpensesDT.TableName = "ResExpensesDT"
ExportDS.Tables.Add(ResExpensesDT)
ResExpNomDT.TableName = "ResExpNomDT"
ExportDS.Tables.Add(ResExpNomDT)
RevenueDT.TableName = "RevenueDT"
ExportDS.Tables.Add(RevenueDT)
ExpensesDT.TableName = "ExpensesDT"
ExportDS.Tables.Add(ExpensesDT)
RevenueNomDT.TableName = "RevenueNomDT"
ExportDS.Tables.Add(RevenueNomDT)
ExpensesNomDT.TableName = "ExpensesNomDT"
ExportDS.Tables.Add(ExpensesNomDT)
Now it appears to be working correctly :-)

first_or_initialize is not working for relative model and creating new record each time

ccs.each do |cd|
relative_model = main_model.relative_model.where(start_date: XYZ, end_date: XYZ).first_or_initialize
relative_model.capacity = cd['capacity'].to_f
relative_model.save!
end
As per above code, first_or_initialize is not working for relative model and creating new record each time.
Here is the query run at background for both inr:
SELECT `capacity_commitments`.* FROM `capacity_commitments` WHERE `capacity_commitments`.`participants_subscription_id` = 1 AND `capacity_commitments`.`start_date` = '2016-11-16' AND `capacity_commitments`.`end_date` = '2016-11-21'
SELECT `capacity_commitments`.* FROM `capacity_commitments` WHERE `capacity_commitments`.`participants_subscription_id` = 1 AND `capacity_commitments`.`start_date` = '2016-11-16' AND `capacity_commitments`.`end_date` = '2016-11-21'
NEED INITIAL HELP OR POINT OUT WHAT IS WRONG IN ABOVE CODE?
Try to use find_or_initialize_by method
relative_model = main_model.relative_model.find_or_initialize_by(start_date: XYZ, end_date: XYZ)

gdata.data.PhoneNumber: How do I get the type of Phone Number?

Using the class gdata.data.PhoneNumber, how do I get the type (Home/Business/Mobile/etc.) of that phone number?
This is the documentation I am referencing: https://gdata-python-client.googlecode.com/hg/pydocs/gdata.data.html#PhoneNumber
The "rel" attribute should be what you are looking for.
This is example code from https://github.com/google/gdata-python-client/blob/master/tests/gdata_tests/contacts/service_test.py:
# Create a new entry
new_entry = gdata.contacts.ContactEntry()
new_entry.title = atom.Title(text='Elizabeth Bennet')
new_entry.content = atom.Content(text='Test Notes')
new_entry.email.append(gdata.contacts.Email(
rel='http://schemas.google.com/g/2005#work',
primary='true',
address='liz#gmail.com'))
new_entry.phone_number.append(gdata.contacts.PhoneNumber(
rel='http://schemas.google.com/g/2005#work', text='(206)555-1212'))
new_entry.organization = gdata.contacts.Organization(
org_name=gdata.contacts.OrgName(text='TestCo.'),
rel='http://schemas.google.com/g/2005#work')
It doesn't access the "rel" attribute but it is there, I swear :)
Once you get a PhoneNumer instance you can print every attribute with the built-in dir() function:
print(dir(phone_number))
The following is a list of "rel"s (https://github.com/google/gdata-python-client/blob/master/src/gdata/data.py). I don't know whether all are applicable to phone numbers or not but it may be useful for checking the type:
FAX_REL = 'http://schemas.google.com/g/2005#fax'
HOME_REL = 'http://schemas.google.com/g/2005#home'
HOME_FAX_REL = 'http://schemas.google.com/g/2005#home_fax'
ISDN_REL = 'http://schemas.google.com/g/2005#isdn'
MAIN_REL = 'http://schemas.google.com/g/2005#main'
MOBILE_REL = 'http://schemas.google.com/g/2005#mobile'
OTHER_REL = 'http://schemas.google.com/g/2005#other'
OTHER_FAX_REL = 'http://schemas.google.com/g/2005#other_fax'
PAGER_REL = 'http://schemas.google.com/g/2005#pager'
RADIO_REL = 'http://schemas.google.com/g/2005#radio'
TELEX_REL = 'http://schemas.google.com/g/2005#telex'
TTL_TDD_REL = 'http://schemas.google.com/g/2005#tty_tdd'
WORK_REL = 'http://schemas.google.com/g/2005#work'
WORK_FAX_REL = 'http://schemas.google.com/g/2005#work_fax'
WORK_MOBILE_REL = 'http://schemas.google.com/g/2005#work_mobile'
WORK_PAGER_REL = 'http://schemas.google.com/g/2005#work_pager'
NETMEETING_REL = 'http://schemas.google.com/g/2005#netmeeting'
Those OTHER "rel"s can (or maybe should?) be joined with the object's "label" attribute.

Resources